//package com.icsss.test1.controller;
//
//import com.alibaba.csp.sentinel.annotation.SentinelResource;
//import com.alibaba.csp.sentinel.slots.block.BlockException;
//import com.icsss.test1.service.Test1Service;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.client.RestTemplate;
//
//@Api("这是测试用类")
//@RestController
//public class TestController {
//
//    private final RestTemplate restTemplate;
//
//    @Autowired
//    public TestController(RestTemplate restTemplate) {this.restTemplate = restTemplate;}
//
//    @RequestMapping(value = "/echo/{str}", method = RequestMethod.GET)
//    public String echo(@PathVariable String str) {
//
////            restTemplate.getForObject();
//        return restTemplate.getForObject("http://test2/echo/" + str, String.class);
//    }
//
//    @Autowired
//    Test1Service service;
//
//
//    @ApiOperation(value = "aaa", notes = "hell微服务path")
//    @SentinelResource(value = "aaa", blockHandler = "exceptionHandler",fallback = "failFallback")
//    @RequestMapping(value = "hell1/{str}", method = RequestMethod.GET)
//    public String hell1(@PathVariable String str) {
//
//        return service.service0(str);
//    }
//
//    public String exceptionHandler(String s, BlockException ex) {
//        // Do some log here.
//        ex.printStackTrace();
//        return "exceptionHandler Oops, error occurred at " + s;
//    }
//
//    public String failFallback(String s, Exception ex) {
//        // Do some log here.
//        ex.printStackTrace();
//        return "failFallback Oops, error occurred at " + s;
//    }
//
//}
//
